package io.gitee.chearnee.fw.openapi.exception;

import io.gitee.chearnee.fw.openapi.constant.enums.ResultCode;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 2021/9/23 14:44
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class OpenApiAsserts {

    public static void error(ResultCode code) {
        error(code, code.getDesc());
    }

    public static void error(ResultCode code, String message) {
        throw new OpenApiException(code, message);
    }
}
